package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.AttendanceMonthlyAddDTO;
import org.jsola.hr.dto.AttendanceMonthlyUpdateDTO;
import org.jsola.hr.query.AttendanceMonthlyQuery;
import org.jsola.hr.vo.AttendanceMonthlyListVO;
import org.jsola.hr.vo.AttendanceMonthlyVO;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * @author zhr
 */
@Api(tags = "hr-员工考勤月统计")
public interface IAttendanceMonthlyControllerAPI {

    /**
     * 新增员工考勤月统计
     * @param attendanceMonthlyAddDTO 员工考勤月统计新增实体
     * @return 员工考勤月统计展示对象
     */
    @ApiOperation(value = "新增员工考勤月统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceMonthlyAddDTO", dataType = "AttendanceMonthlyAddDTO", value = "新增员工考勤月统计", paramType = "body")
    })
    Result<AttendanceMonthlyVO> save(AttendanceMonthlyAddDTO attendanceMonthlyAddDTO);


    /**
     * 修改员工考勤月统计
     * @param attendanceMonthlyUpdateDTO 员工考勤月统计
     * @return 更新数量
     */
    @ApiOperation(value = "修改员工考勤月统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceMonthlyUpdateDTO", dataType = "AttendanceMonthlyUpdateDTO", value = "修改员工考勤月统计", paramType = "body")
    })
    Result<Integer> update(AttendanceMonthlyUpdateDTO attendanceMonthlyUpdateDTO);




    /**
     * 删除单个员工考勤月统计，彻底删除
     * @param attendanceMonthlyId 员工考勤月统计id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个员工考勤月统计，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceMonthlyId", dataType = "String", value = "员工考勤月统计id", paramType = "path")
    })
    Result<Integer> delete(String attendanceMonthlyId);


    /**
     * 批量删除员工考勤月统计，彻底删除
     * @param attendanceMonthlyIds 员工考勤月统计id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除员工考勤月统计，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceMonthlyIds", dataType = "String[]", value = "员工考勤月统计id数组", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] attendanceMonthlyIds);


    /**
     * 根据员工考勤月统计id查询员工考勤月统计详情
     * @param attendanceMonthlyId 员工考勤月统计id
     * @return 员工考勤月统计详情
     */
    @ApiOperation(value="根据员工考勤月统计id查询员工考勤月统计详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceMonthlyId", dataType = "String", value = "员工考勤月统计id", paramType = "path")
    })
    Result<AttendanceMonthlyVO> findById(String attendanceMonthlyId);


    /**
     * 查询员工考勤月统计
     * @param attendanceMonthlyQuery 员工考勤月统计查询参数
     * @return page
     */
    @ApiOperation(value="查询员工考勤月统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceMonthlyQuery", dataType = "AttendanceMonthlyQuery", value = "员工考勤月统计查询参数", paramType = "query")
    })
    Result<List<AttendanceMonthlyListVO>> listAll(AttendanceMonthlyQuery attendanceMonthlyQuery);


     /**
     * 分页查询员工考勤月统计
     * @param attendanceMonthlyQuery 员工考勤月统计查询参数
     * @return page
     */
    @ApiOperation(value="分页查询员工考勤月统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceMonthlyQuery", dataType = "AttendanceMonthlyQuery", value = "员工考勤月统计查询参数", paramType = "query")
    })
    Result<Page<AttendanceMonthlyListVO>> page(AttendanceMonthlyQuery attendanceMonthlyQuery);

    /**
     * 分页查询员工工资报表
     * @param attendanceMonthlyQuery 员工考勤月统计查询参数
     * @return page
     */
    @ApiOperation(value="分页查询员工考勤月统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceMonthlyQuery", dataType = "AttendanceMonthlyQuery", value = "员工考勤月统计查询参数", paramType = "query")
    })
    Result<Page<AttendanceMonthlyVO>> getAttendanceMonthlyReportByPage(@Valid AttendanceMonthlyQuery attendanceMonthlyQuery);

    /**
     * 导出员工工资报表
     * @param attendanceMonthlyQuery 员工考勤月统计查询参数
     * @param response  响应体
     * @throws   UnsupportedEncodingException;
     */
    @GetMapping(value = "/导出员工工资报表")
    void downloadAttendanceMonthlyReport(@Valid AttendanceMonthlyQuery attendanceMonthlyQuery, HttpServletResponse response) throws UnsupportedEncodingException;

    @ApiOperation(value="获取月考勤记录数量")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceMonthlyQuery", dataType = "AttendanceMonthlyQuery", value = "员工考勤月统计查询参数", paramType = "query")
    })
    Result<Integer> getAttendanceMonthlyCount(@Valid AttendanceMonthlyQuery attendanceMonthlyQuery);

    /**
     * 获取月考勤记录归档历史
     * @param attendanceMonthlyQuery 员工考勤月统计查询参数
     * @return page
     */
    @ApiOperation(value="获取月考勤记录归档历史")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceMonthlyQuery", dataType = "AttendanceMonthlyQuery", value = "员工考勤月统计查询参数", paramType = "query")
    })
    Result<List<AttendanceMonthlyVO>> getAttendanceMonthlyFileHistory(@Valid AttendanceMonthlyQuery attendanceMonthlyQuery);

}

